lib/sysroot: Support /usr/lib/modules/$kver for kernel/initramfs
authorColin Walters <walters@verbum.org>
Tue, 15 Aug 2017 15:22:21 +0000 (11:22 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 18 Aug 2017 17:34:36 +0000 (17:34 +0000)
commit3ab0d5e6644885440bac6abd17b6d2637df5435f
treead813c7d029bedb6b93d533c43af1c6693f0fd3d
parent984d22303ddbf2c2553dc283ce29e0aaf2b13b6d
lib/sysroot: Support /usr/lib/modules/$kver for kernel/initramfs

This is the new Fedora kernel standard layout; it has the advantage
of being in `/usr` like `/usr/lib/ostree-boot`, but it's not OSTree
specific.

Further, I think in practice forcing tree builders to compute the checksum is an
annoying stumbling block; since we already switched to e.g. computing checksums
always when doing pulls, the cost of doing another checksum for the
kernel/initramfs is tiny. The "bootcsum" becomes more of an internal
implementation detail.

Now, there is a transition; my current thought for this is that rpm-ostree will
change to default to injecting into both `/usr/lib/ostree-boot` and
`/usr/lib/modules`, and stop doing `/boot`, then maybe next year say we drop the
`/usr/lib/ostree-boot` by default.

A twist here is that the default Fedora kernel RPM layout (and what's in
rpm-ostree today) includes a kernel but *not* an initramfs in
`/usr/lib/modules`. If we looked only there, we'd just find the kernel. So we
need to look in both, and then special case this - pick the legacy layout if we
have `/usr/lib/modules` but not an initramfs.

While here, rework the code to have an `OstreeKernelLayout` struct which makes
dealing with all of the variables nicer.

Closes: #1079
Approved by: jlebon
docs/manual/deployment.md
src/libostree/ostree-sysroot-deploy.c
tests/libtest.sh
tests/test-admin-deploy-syslinux.sh
tests/test-admin-deploy-uboot.sh